﻿using J.Status.Application.Command.RoomTypeCommand;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.RoomTypeHandler
{
    public class RoomTypeDeleteHandler : IRequestHandler<RoomTypeDeleteCommand, int>
    {
        private readonly IRoomTypeService roomTypeService;

        public RoomTypeDeleteHandler(IRoomTypeService roomTypeService)
        {
            this.roomTypeService = roomTypeService;
        }

        public async Task<int> Handle(RoomTypeDeleteCommand request, CancellationToken cancellationToken)
        {
            return await roomTypeService.DeleteRangeRoomType(request.id);
        }
    }
}
